<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>test struct</title>

    <!-- load 依赖的库 -->
    <script src="../libs/system.js"></script>
    <script>
        System.import('../libs/cc.js');
    </script>

    <!-- load 一些工具函数 -->
    <script src="../src/utils/gltfParser.js"></script>
    <script src="../src/utils/ajax.js"></script>
    <script src="../src/utils/globalCache.js"></script>

    <!-- load需要的 -->
    <script src="../src/debugUtils.js"></script>
    <script src="../src/graphics.js"></script>
    <script src="../src/v1/camera.js"></script>
    <script src="../src/v1/rendererV1.js"></script>
    <script src="../src/v1/mesh.js"></script>

    <script src="../src/template.js"></script>
    <script>
        let renderer,camera;
        app.init  = function () {

            for(let k in cc.geometry){
                console.log(k);
            }

            console.log('app init called!');
            camera  = new Camera();
            camera.lookAt(cc.v3(0,2,5),cc.v3(),cc.Vec3.UNIT_Y);

            const fov = 60 * Math.PI / 180;
            const aspect = this.width / this.height;
            camera.project(fov,aspect,0.1,1000);

            // init renderer
            renderer = new RendererV1(camera);

            // init mesh
            GLTFLoader.load('./assets/ground_8.gltf',(err,meshInfo)=>{
                if(err) throw err;
                let mesh = new Mesh(meshInfo);
                renderer.add(mesh);
            });
        };
        app.update = function () {

        };
        app.render = function () {
            renderer.render();
        }
    </script>
</head>
<body>

</body>
</html>
